package model;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

public class User3 implements BeanNameAware, BeanFactoryAware {
    @Override
    public void setBeanName(String s) {
        System.out.println("通知方法:BeanNameAware");
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        System.out.println("通知方法:BeanFactoryAware");
    }
    public void init(){
        System.out.println("初始化方法:init");
    }
    @PostConstruct
    public void postConstruct(){
        System.out.println("初始化方法:PostConstruct");
    }
    @PreDestroy
    public void preDestroy(){
        System.out.println("销毁方法:preDestroy");
    }
    public void destroy(){
        System.out.println("销毁方法:destroy");
    }
}
